basedir:=$(shell dirname ${PWD})/inputs  # 在每章的目录下进行 make 时 basedir 为父目录

.PHONY: default slides clean

default:  # f = file 代表文件
	export TEXINPUTS=${TEXINPUTS}:${basedir}; xelatex ${f}

slides: # f = file 代表文件
	export TEXINPUTS=${TEXINPUTS}:${basedir}; cp ${f}.tex ${f}_slides.tex
	sed -i '1s/handout//' ${f}_slides.tex
	export TEXINPUTS=${TEXINPUTS}:${basedir}; xelatex ${f}_slides

clean:
	-rm -f -r _minted* *.aux *.bcf *.xml *.out *.toc *.snm *.nav *.log *.vrb *.blg *.bbl *.ptc *.idx *_slides.tex
